<template>
  <div class="step-box">
    <div class="form-box">
      <p v-if="type === 'enter'" class="sub-title">运营审核</p>
      <div class="result-box">
        <template v-if="status === -1">
          <template v-if="type === 'enter'">
            <p class="status"><i class="el-icon-warning warning-icon" />您已成功提交入驻申请，预计3-5个工作日反馈审核结果，请耐心等待</p>
            <p class="tip">等待期间您可以登录本账号查看审核进度或关注短信了解进度</p>
          </template>
          <template v-if="type === 'shop'">
            <p class="status"><i class="el-icon-warning warning-icon" /> 等待平台审核（1-3工作日）</p>
            <p class="handle"><el-button type="primary" @click="cancel">撤销发布</el-button></p>
          </template>
        </template>

        <template v-if="status === 1">
          <template v-if="type === 'enter'">
            <p class="status"><i class="el-icon-circle-check success-icon" />恭喜您审核通过，现在您可以选择签署协议去开店</p>
            <p class="handle"><el-button type="primary" @click="gotoSign">签署协议</el-button></p>
          </template>
        </template>
        <template v-if="status=== 0">
          <p class="status"><i class="el-icon-error fail-icon" />很遗憾，您的审核尚未通过，请根据驳回原因修改后再次提交审核</p>
          <p class="message">这里可以查看<el-button type="text" class="audit-detail" @click="showLog">审核日志详情</el-button></p>
          <p class="handle"><el-button type="primary" @click="reSubmit">重新提交</el-button></p>
        </template>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: 'Result',
  props: {
    type: {
      // 'enter': 入驻审核  'shop': 店铺审核
      type: String,
      default: ''
    },
    status: {
      // -1 待审核  0 审核未通过  1 审核通过  2 已撤回
      type: [Number, String],
      default: -1
    }
  },
  data() {
    return {
    }
  },

  methods: {

    // 重新提交
    reSubmit() {
      this.$emit('resubmit')
    },

    // 展示拒绝原因
    showLog() {
      this.$emit('reason')
    },

    // 去签署协议
    gotoSign() {
      this.$emit('sign')
    },

    // 撤销
    cancel() {
      this.$emit('cancel')
    }

  }
}
</script>
<style lang="scss" scoped>
@import "step";
</style>
